# camera_handler.py
import cv2

class CameraHandler:
    def __init__(self):
        self.cap = cv2.VideoCapture(1)
        self.cap.set(3, 1920)
        self.cap.set(4, 1080)


    def capture_frame(self):
        ret, frame = self.cap.read()
        if not ret:
            print("摄像头异常")

        return frame

    def show_frame(self, frame):
        cv2.imshow("frame", frame)
        cv2.waitKey(1)
